package com.summer.main;

public class EqTest {

	public static void main(String[] args) {
		AOBJ a = new AOBJ();
		AOBJ b = new AOBJ();
		BOBJ aa = new BOBJ();
		BOBJ bb = new BOBJ();
		COBJ aaa = new COBJ();
		COBJ bbb = new COBJ();
		
		long ss= (1l << 30l) | 123456789l;
		System.out.println(String.valueOf((ss & ~(1l << 30l))));
		System.out.println(parseImageNameBy("https://p.qiremanhua.com/uploads/chapter/10939/202004/5e9966e572bd7.jpg?x-oss-process=image/quality,q_90/format,webp"));
		System.out.println("a == b "+(a==b));
		System.out.println("a eq b "+(a.equals(b)));
		System.out.println("aa == bb "+(aa==bb));
		System.out.println("aa eq bb "+(aa.equals(bb)));
		System.out.println("aaa == bbb "+(aaa==bbb));
		System.out.println("aaa eq bbb "+(aaa.equals(bbb)));
		System.out.println("1 eq bbb "+(new Integer(1).equals(bbb)));
		
		boolean isE = false;
		isE |= false;
		System.out.println(isE);
		isE |= true;
		System.out.println(isE);
		isE |= false;
		System.out.println(isE);
		isE |= true;
		System.out.println(isE);
		
	}
	
	public static class AOBJ{
		int id;
	}
	
	public static class BOBJ{
		int id;
		
		@Override
		public boolean equals(Object obj) {
			if(obj instanceof BOBJ)
				return ((BOBJ) obj).id == id;
			return super.equals(obj);
		}
	}
	
	public static class COBJ{
		Integer id = 1;
		@Override
		public int hashCode() {
			// TODO Auto-generated method stub
			return id.hashCode();
		}
	}
	  public static String parseImageNameBy(String url) {
	        String name = url.substring(0, url.lastIndexOf("?"));
	        return name.substring(name.lastIndexOf("/") + 1);
	    }
}
